#pragma pack(1)

#define NRO_PAGES 5
#define NRO_COLORSPAGE 20

typedef struct _COLORENTRY_{
	COLORREF color;
	BYTE flg;
} *PCOLORENTRY, COLORENTRY;

typedef struct _COLORPAGE_{
	char name[100];
	COLORENTRY color[NRO_COLORSPAGE];
} *PCOLORPAGE, COLORPAGE;

typedef struct _COLORSWND_{
	int iPage;					// Page index
	COLORPAGE page[NRO_PAGES];
	HWND hwndPalette;
	COLORREF bufferColor;		// To support the copy/paste actions
	// To the palette admin	
	int iColor;					// Color index
	HBRUSH brushBack;
	HBRUSH brushSelect;
	PCOLORPAGE curPage;
	// Palette Serialization
	BOOL isChanged;
	char fileName[300];
} *PCOLORSWND, COLORSWND;

HWND colorsWndCreate(HWND hwndParent, int x, int y, int dx, int dy);

int colorsWndRegister(HINSTANCE instancia);